﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

public class NativeCallback:MonoBehaviour
{

    public Action<float> onDetectFreq;

    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
        gameObject.name = "NativeCallback";
    }

    // Use this for initialization
    void Start()
    {

    }


    public void OnFrequencyResult(string frequencyStr)
    {
        Debug.Log($"OnFrequencyResult : {frequencyStr}");

        float.TryParse(frequencyStr, out float freq);

        onDetectFreq?.Invoke(freq);
    }
}

